package adventure_game;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * Reads the config file called adventure.properties.
 * @author Frank, Morten B, Ronni
 */
public class ConfigReader
{
    private Properties props;

    public ConfigReader(String fileName) throws IOException
    {
        props = new Properties();
        props.load(new FileReader(fileName));
    }

    public String getProperty(String key)
    {
        return props.getProperty(key);
    }

    /**
    * Reads the adventure.properties file.
    */
    public ConfigReader() throws IOException
    {
        Properties props = new Properties();
        props.load(new FileReader("adventure.properties"));
        String value = props.getProperty("rooms");
        String[] roomNames = value.split(",");
    }
}
